package com.itlong.cloud.user.app;

import com.itlong.cloud.POJO.DTO.app.old.AppOldUserInfoDto;
import com.itlong.cloud.POJO.VO.app.old.AppOldUserInfoVO;
import com.itlong.cloud.enumerate.oldapp.Code;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <desc>
 *     旧版APP的注册登录版块接口暴露
 * </desc>
 * Created 2017/10/17
 */
@FeignClient(name = "user-service")
public interface IAppOldRegisterServiceClient {
    /**
     * <desc>
     *     根据用户输入对象查询用户响应对象集合
     * </desc>
     * @param appOldUserInfoDto
     * @return
     * @author cuiduanwu
     * @createDate 2017/10/17
     */
    @RequestMapping(path = "/app/user/selectVOByDTO",method = RequestMethod.POST)
    List selectVOByDTO(@RequestBody AppOldUserInfoDto appOldUserInfoDto);


    /**
     * <desc>
     *     根据手机号查询用户VO
     * </desc>
     * @param phoneNo
     * @return
     * @author cuiduanwu
     * @createDate 2017/10/17
     */
    @RequestMapping(path = "/app/user/selectVOByPhone",method = RequestMethod.POST)
    AppOldUserInfoVO selectVOByPhone(@RequestParam("phoneNo") String phoneNo);



    /**
     * <desc>
     *     根据手机号查询用户DTO
     * </desc>
     * @param phoneNo
     * @return
     * @author cuiduanwu
     * @createDate 2017/10/17
     */
    @RequestMapping(path = "/app/user/selectDTOByPhone",method = RequestMethod.POST)
    AppOldUserInfoDto selectDtoByPhone(@RequestParam("phoneNo") String phoneNo);

    /**
     * <desc>
     *     根据用户DTO更新用户信息
     * </desc>
     * @param appOldUserInfoDto
     * @return
     * @author cuiduanwu
     * @createDate 2017/10/18
     */
    @RequestMapping(path = "/app/user/updateNotNullByAppOldUserInfoDto",method = RequestMethod.POST)
    boolean updateNotNullByAppOldUserInfoDto(@RequestBody AppOldUserInfoDto appOldUserInfoDto);


    /**
     * <desc>
     *     保存旧版App用户对象至缓存
     * </desc>
     * @param appOldUserInfoDto
     * @return
     * @author cuiduanwu
     * @createDate 2017/10/18
     */
    @RequestMapping(path = "/app/user/saveCacheUser",method = RequestMethod.POST)
    AppOldUserInfoDto saveCacheUser(@RequestBody AppOldUserInfoDto appOldUserInfoDto);

    /**
     * <desc>
     *     旧版APP_注册提交
     * </desc>
     * @param appOldUserInfoVO
     * @param pswd   已加密密码
     * @return
     * @author cuiduanwu
     * @createDate 2017/10/18
     */
    @RequestMapping(path = "/app/registerProjectInfo",method = RequestMethod.POST)
    Code registerProjectInfo(@RequestBody AppOldUserInfoVO appOldUserInfoVO,@RequestParam("pswd") String pswd) throws  Exception;

    /**
     * <desc>
     *     旧版APP_登录
     * </desc>
     * @param phoneNo
     * @param pswd 已加密的密码
     * @param loginDevice
     * @return
     * @throws Exception
     * @author cuiduanwu
     * @createDate 2017/10/23
     */
    @RequestMapping(path = "/app/login",method = RequestMethod.POST)
    AppOldUserInfoVO appLogin(@RequestParam("phoneNo") String phoneNo,@RequestParam("pswd") String pswd,@RequestParam("loginDevice") String loginDevice) throws Exception;


    /**
     *<desc>
     *     旧版APP_忘记密码提交
     *</desc>
     * @param phoneNo
     * @param pswd 已加密的密码
     * @return
     * @throws Exception
     * @author cuiduanwu
     * @createDate 2017/10/30
     */
    @RequestMapping(path = "/app/retrievePswd",method = RequestMethod.POST)
    Code appRetrievePswd(@RequestParam("phoneNo") String phoneNo,@RequestParam("pswd") String pswd) throws Exception;


    /**
     * <desc>
     *     旧版APP_更新头像
     * </desc>
     * @param userId
     * @param imageStr
     * @param imageType
     * @return
     * @createDate 2017/10/30
     * @author cuiduanwu
     */
    @RequestMapping(path = "/app/updatePhoto",method = RequestMethod.POST)
    String updatePhoto(@RequestParam("userId") String userId,@RequestParam("imageStr") String imageStr,@RequestParam("imageType") String imageType) throws  Exception;

    /**
     * <desc>
     *     旧版APP_修改密码
     * </desc>
     * @param phoneNo
     * @param oldPswd  已加密的旧密码
     * @param newPswd  已加密的新密码
     * @return
     * @throws Exception
     * @createDate 2017/10/30
     * @author cuiduanwu
     */
    @RequestMapping(path = "/app/updatePswd",method = RequestMethod.POST)
    Code appUpdatePswd(@RequestParam("phoneNo") String phoneNo,@RequestParam("oldPswd") String oldPswd,@RequestParam("newPswd") String newPswd) throws Exception;

    /**
     * <desc>
     *     旧版APP_修改手机号
     * </desc>
     * @param phoneNo 旧手机号
     * @param loginPswd  已加密的密码
     * @param replacePhoneNo  新手机号
     * @return
     * @throws Exception
     * @createDate 2017/10/30
     * @author cuiduanwu
     */
    @RequestMapping(path = "/app/updatePhone",method = RequestMethod.POST)
    Code appUpdatePhone(@RequestParam("phoneNo") String phoneNo,@RequestParam("loginPswd") String loginPswd,@RequestParam("replacePhoneNo") String replacePhoneNo) throws Exception;

    /**
     * <desc>
     *     旧版APP_修改昵称
     * </desc>
     * @param phoneNo
     * @param nickName
     * @return
     * @throws Exception
     * @createDate 2017/10/30
     * @author cuiduanwu
     */
    @RequestMapping(path = "/app/updateNickName",method = RequestMethod.POST)
    Code updateNickName(@RequestParam("phoneNo") String phoneNo,@RequestParam("nickName") String nickName) throws  Exception;

    /**
     * <desc>
     *     旧版APP_修改姓名
     * </desc>
     * @param phoneNo
     * @param userName
     * @return
     * @throws Exception
     * @createDate 2017/10/30
     * @author cuiduanwu
     */
    @RequestMapping(path = "/app/updateUserName",method = RequestMethod.POST)
    Code appUpdateUserName(@RequestParam("phoneNo") String phoneNo,@RequestParam("userName") String userName) throws  Exception;

    /**
     * <desc>
     *     旧版APP_修改性别
     * </desc>
     * @param phoneNo
     * @param sex 性别：0男 1女
     * @return
     * @throws Exception
     * @createDate 2017/10/30
     * @author cuiduanwu
     */
    @RequestMapping(path = "/app/updateUserSex",method = RequestMethod.POST)
    Code updateUserSex(@RequestParam("phoneNo") String phoneNo,@RequestParam("sex") String sex) throws  Exception;


    /**
     *  <desc>
     *      旧版APP_检查核验用户的token正确性
     *  </desc>
     * @param phoneNo
     * @param token
     * @return
     * @createDate 2017/10/30
     * @author cuiduanwu
     */
    @RequestMapping(path = "/app/checkUserStatus",method = RequestMethod.POST)
    Code checkUserStatus(@RequestParam("phoneNo") String phoneNo,@RequestParam("token") String token);






























}
